
package com.zjxd.business.web.api.funds;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zjxd.business.web.common.ApiResult;
import com.zjxd.business.web.common.BaseService;
import com.zjxd.business.web.model.pojo.TBFunds;
import com.zjxd.business.web.model.pojo.TBFundsExample;
import com.zjxd.business.web.utils.CoreUtil;

@Service
public class TBFundsServiceImpl extends BaseService implements TBFundsService {

	@Override
	public ApiResult getFundsPage(FundsModel model) {

		if (CoreUtil.isBlank(model.getUserId())) { return ApiResult.fail("请上传用户id"); }
		TBFundsExample example = new TBFundsExample();
		example.createCriteria().andUseridEqualTo(Long.parseLong(model.getUserId()));
		PageHelper.startPage(model.getPageNum(), model.getPageSize());
		PageInfo<TBFunds> page = new PageInfo<TBFunds>(tBFundsMapper.selectByExample(example));
		return ApiResult.success(page);
	}
}
